<?php
namespace app\index\controller;

use think\Db;
class Index
{
    public function index()
    {
        //get获取数据
        if($_GET){
            $get = $_GET;
            $wishes_id = $get['wishes_id'];
            $sex = $get['sex'];
        }
        $where['wishes_id'] = $wishes_id;
        $where['sex'] = $sex;
        $result = Db::table('mop_wishes')->where($where)->select();
        $max = count($result)-1;
        // var_dump($result[rand(0,$max)]);die;
        return json($result[rand(0,$max)]);
    }
}
